//
//  HeaderView.m
//  FindJob
//
//  Created by apple on 16/3/8.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "HeaderView.h"

@implementation HeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor clearColor];
        self.layer.borderWidth = 0.34;
        self.layer.borderColor = [UIColor lightGrayColor].CGColor;
        
        [self.contentView addSubview:self.gestureImageView];
        [self.contentView addSubview:self.sectionLabel];
        /**添加手势 */
        UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(respondsToTapGesture:)];
        [self addGestureRecognizer:tapGesture];
    }
    return self;
}
#pragma mark - gesture
-(void)respondsToTapGesture:(UITapGestureRecognizer *)gesture{
    if (_delegate && [_delegate conformsToProtocol:@protocol(HeaderViewDelegate)]) {
        [_delegate headerView:self didSelecedWithTag:self.tag];
    }
  
}
#pragma mark - getters
- (UIImageView *)gestureImageView{
    if (!_gestureImageView) {
        _gestureImageView = [[UIImageView alloc] initWithFrame:CGRectMake(350, 10, 40, 40)];
    
    }
    return _gestureImageView;
}
- (UILabel *)sectionLabel{
    if (!_sectionLabel) {
        _sectionLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 100, 30)];

        _sectionLabel.font = [UIFont systemFontOfSize:20];
    }
    return _sectionLabel;
}



@end
